package com.shitou.shitouproduct.vo;

import com.shitou.shitouproduct.exception.AddGroup;
import com.shitou.shitouproduct.exception.AllGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * class detail:
 *
 * @author 石头人
 */
@SuppressWarnings("all")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ProductInfoVo implements Serializable {

    // 分类id
    private int categoryId;
    // 分类名字
    private String name;
    // 分类父id
    private int parentCid;

    // 品牌id
    private int brandId;

    // 该品牌下售卖的商品名称
    private String brandSellName;

    // spu商品标题
    @NotEmpty(message = "商品标题不能为空", groups = {AddGroup.class})
    private String spuTitle;

    // spu商品详细介绍
    @NotEmpty(message = "商品详细描述不能为空", groups = {AddGroup.class})
    private String spuDetail;

    // 商品的图片集合
    private String[] imageUrls;

    // 商品价格
    private BigDecimal price;

    // 会员id
    @NotNull(message = "未有会员登陆", groups = {AddGroup.class, AllGroup.class})
    private int id;

    // 属性列表
    private AttrInfo[] allAttr;

    private int spuId;
    private int skuId;
    private int publishStatus;

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

}


